package com.sxt.demo.djiapplication.entity.flightdata;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Keep;
import org.greenrobot.greendao.annotation.Property;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

@Entity(nameInDb = "flight_data")
public class FlightData {

    @Id(autoincrement = true)
    @Property(nameInDb = "id")
    private Long id;

    @Property(nameInDb = "velocity_x")
    private float velocityX;

    @Property(nameInDb = "velocity_y")
    private float velocityY;

    @Property(nameInDb = "velocity_z")
    private float velocityZ;

    @Property(nameInDb = "voltage")
    private int voltage;

    @Property(nameInDb = "current")
    private int current;

    @Property(nameInDb = "latitude")
    private double latitude;

    @Property(nameInDb = "longitude")
    private double longitude;

    @Property(nameInDb = "altitude")
    private float altitude;

    @Property(nameInDb = "heading")
    private float heading;

    @Property(nameInDb = "record_time")
    private String recordTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS", Locale.CHINA)
            .format(new Date(System.currentTimeMillis()));

    @Generated(hash = 1061041527)
    public FlightData(Long id, float velocityX, float velocityY, float velocityZ, int voltage, int current, double latitude, double longitude,
            float altitude, float heading, String recordTime) {
        this.id = id;
        this.velocityX = velocityX;
        this.velocityY = velocityY;
        this.velocityZ = velocityZ;
        this.voltage = voltage;
        this.current = current;
        this.latitude = latitude;
        this.longitude = longitude;
        this.altitude = altitude;
        this.heading = heading;
        this.recordTime = recordTime;
    }

    @Generated(hash = 862518874)
    public FlightData() {
    }

    @Keep
    public FlightData(float velocityX, float velocityY, float velocityZ, int voltage, int current, double latitude, double longitude, float altitude, float heading) {
        this.velocityX = velocityX;
        this.velocityY = velocityY;
        this.velocityZ = velocityZ;
        this.voltage = voltage;
        this.current = current;
        this.latitude = latitude;
        this.longitude = longitude;
        this.altitude = altitude;
        this.heading = heading;
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public float getVelocityX() {
        return this.velocityX;
    }

    public void setVelocityX(float velocityX) {
        this.velocityX = velocityX;
    }

    public float getVelocityY() {
        return this.velocityY;
    }

    public void setVelocityY(float velocityY) {
        this.velocityY = velocityY;
    }

    public float getVelocityZ() {
        return this.velocityZ;
    }

    public void setVelocityZ(float velocityZ) {
        this.velocityZ = velocityZ;
    }

    public int getVoltage() {
        return this.voltage;
    }

    public void setVoltage(int voltage) {
        this.voltage = voltage;
    }

    public int getCurrent() {
        return this.current;
    }

    public void setCurrent(int current) {
        this.current = current;
    }

    public String getRecordTime() {
        return this.recordTime;
    }

    public void setRecordTime(String recordTime) {
        this.recordTime = recordTime;
    }

    public float getAltitude() {
        return this.altitude;
    }

    public void setAltitude(float altitude) {
        this.altitude = altitude;
    }

    public double getLatitude() {
        return this.latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return this.longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public float getHeading() {
        return this.heading;
    }

    public void setHeading(float heading) {
        this.heading = heading;
    }


}
